package cn.csxw.openchina.dagger2.presenter;

import java.util.ArrayList;

import javax.inject.Inject;

import cn.csxw.openchina.entity.bean.OsChinaBean;
import cn.csxw.openchina.entity.bean.PostBean;
import cn.csxw.openchina.ui.fragment.exerciseFragment.ExerciseDetailFragment;
import retrofit2.Call;

/**
 * Created by User on 2017/1/16.
 */

public class ExerciseDetailFragmentPresenter extends BasePresenter {
    ExerciseDetailFragment mExerciseDetailFragment;

    @Inject
    public ExerciseDetailFragmentPresenter(ExerciseDetailFragment exerciseDetailFragment) {
        mExerciseDetailFragment = exerciseDetailFragment;
    }

    @Override
    protected void processData(OsChinaBean data) {
        if (data!=null){
            PostBean post = data.post;//
            if (post!=null){
               // mExerciseDetailFragment.mAdapter.setData(post);
            }
        }
    }

    @Override
    public void callNetWork(Object... params) {
      Call<OsChinaBean> detailfInfo = mOsChinaServer.getPostDetailInfo((String)params[0]);
        detailfInfo.enqueue(mCallback);
    }
}
